package com.zhouyu.exampledesignmoudle.builder;

/**
 * @Description:builder模式
 */
public class Productor {
  private Integer price;
  private String level;
  private String maker;
  private String location;
  private int size;

  public static class Mybuilder{
    private Integer price;
    private String level;
    private String maker;
    private String location;
    private int size;
    public Mybuilder(){

    }

    public Mybuilder buildMaker(String maker){
      this.maker=maker;
      return this;
    }

    public Mybuilder buildLocation(String location){
      this.location=location;
      return this;
    }

    public Productor build(){
      return  new Productor(this);
    }
  }

  public Productor(Mybuilder mybuilder) {
    this.level=mybuilder.level;
    this.location=mybuilder.location;
    this.maker=mybuilder.maker;
    this.price=mybuilder.price;
    this.size=mybuilder.size;
  }
}
